# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=zxing
pkgver=3.4.1
pkgrel=1
pkgdesc='Multi-format 1D/2D barcode image processing library (C++ version).'
arch=('x86_64' 'aarch64')
url='https://github.com/zxing/zxing/'
license=('Apache')
makedepends=('scons')
depends=('imagemagick')
source=("https://github.com/zxing/zxing/archive/$pkgname-$pkgver.tar.gz")
sha512sums=('d851a54bc13d7ccfb6cf820983f095086c3a3ba0c611f4a8a467be19ff4c7db54f6f36e73551ec41d3b953b0c0d417f29eafed0c0ed2cec7f66f09f2c9970b26')

build() {
  cd "$pkgname-$pkgname-$pkgver/cpp"

  scons DEBUG=0 -j1 $pkgname
}

package() {
  cd "$pkgname-$pkgname-$pkgver/cpp"

  install -Dm 755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"

  cd ..

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" CHANGES NOTICE AUTHORS
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

